.TH slurmrestd "8" "Slurm REST Daemon" "March 2023" "Slurm REST Daemon"

.SH "NAME"
slurmrestd \- Interface to Slurm via REST API.
.SH "SYNOPSIS"
\fBslurmrestd\fR [\fIOPTIONS\fR...] <\fI[host]:port\fR|\fIunix:/path/to/socket\fR>...
.SH "DESCRIPTION"
\fBslurmrestd\fR is REST API interface for Slurm. It can be used in two modes:

.PP
\fBInetd Mode\fR: slurmrestd will read and write to STDIO. If STDIN is a socket
file descriptor, then slurmrestd will detect this and use relevant
functionality. If a controlling TTY is detected, interactive mode will
automatically activate to provide additional logging information. This mode is
designed to work with piped input, inetd, xinetd or systemd socket activation.

.PP
\fBListen Mode\fR: slurmrestd will open a listening socket on each requested
\fIhost\fR:\fIport\fR pair or UNIX socket.

.SH "OPTIONS"

.TP
\fB[host]:port\fR
Hostname and port to listen against. \fIhost\fR may be an IPv4/IPv6 IP or a
resolvable hostname. Hostnames are only looked up at startup and do not change
for the life of the process. \fIhost\fR is optional; if not provided, slurmrestd
will listen on all network interfaces.
.IP

.TP
\fBunix:/path/to/socket\fR
Listen on local UNIX socket. Must have permission to create socket in
filesystem.
.IP

.TP
\fB\-a <authentication plugins>\fR
Comma\-delimited list of authentication plugins to load.
Default behavior is to load all REST authentication plugins found at load time.
.RS
.TP
\fBlist\fR
Display a list of the possible plugins to load.
.IP

.TP
\fBrest_auth/local\fR
Allows authentication via UNIX sockets when \fBauth/munge\fR is active.
.br
\fBNOTE\fR: slurmrestd and client processes must run under the same UID or the
client requests will be rejected.
.IP

.TP
\fBrest_auth/jwt\fR
Allows authentication via TCP and UNIX sockets when \fBAuthAltTypes=auth/jwt\fR
is active. User must specify the following HTTP cookies with each request:
.RS
.TP
\fBX-SLURM-USER-NAME\fR:<user name>
.IP
.TP
\fBX-SLURM-USER-TOKEN\fR:<JSON Web Token>
.RE
.IP
\fBNOTE\fR: Tokens are usually generated via calling "\fBscontrol token\fR".
.RE
.IP

.TP
\fB\-f <file>\fR
Read Slurm configuration from the specified file. See \fBNOTES\fR below.
.IP

.TP
\fB\-g <group id>\fR
Change group id (and drop supplemental groups) before processing client
request. This should be a unique group with no write access or special
permissions. Do not set this to the group belonging to to SlurmUser or
root or the daemon won't start with the default settings.
.IP

.TP
\fB\-h\fR
Help; print a brief summary of command options.
.IP

.TP
\fB\-\-max\-connections <count>\fR
Set the maximum number of connections to process at any one time. This is
independent of the number of connections that can connect to slurmrestd at any
one time. The kernel allows any number of connections to be pending for
processing at any one time when SYN cookies are active.
.RS
.TP
\fBCaution\fR:
Each connection could cause one RPC to the controller daemons, leading to
potential overloading of the controller. Each connection can also hold memory
for the duration of the life of the connection. Having too many connections
processing at once could use considerably more memory. Process limits
(\fBulimit\fR(3)) may require adjustment when this value is increased.
.TP
Default: 124
.RE
.IP

.TP
\fB\-s <OpenAPI plugins to load>\fR
Comma\-delimited list of OpenAPI plugins.
Set to "list" to dump a list of the possible plugins to load.
Defaults: all builtin supported OpenAPI plugins.
.IP

.TP
\fB\-t <THREAD COUNT>\fR
Specify number of threads to use to process client connections.
Ignored in inetd mode. Default: 20
.IP

.TP
\fB\-u <user id>\fR
Change user id before processing client request. This should be a unique group
with no write access or special permissions. Do not set this user to SlurmUser
or root or the daemon won't start with the default settings.
.IP

.TP
\fB\-v\fR
Verbose operation. Multiple \fB\-v\fR's increase verbosity.
Higher verbosity levels will have significant performance impact.
.IP

.TP
\fB\-V\fR
Print version information and exit.
.IP

.SH "ENVIRONMENT VARIABLES"
The following environment variables can be used to override settings
compiled into slurmctld.

.TP
\fBSLURM_CONF\fR
The location of the Slurm configuration file.
.IP

.TP
\fBSLURM_DEBUG_FLAGS\fR
Specify debug flags for slurmrestd to use. See DebugFlags in the
\fBslurm.conf\fR(5) man page for a full list of flags. The environment
variable takes precedence over the setting in the slurm.conf.
.IP

.TP
\fBSLURM_JWT\fR
This variable must be set to use JWT token authentication.
.IP

.TP
\fBSLURMRESTD_AUTH_TYPES\fR
Set allowed authentication types. See \fB\-a\fR
.IP

.TP
\fBSLURMRESTD_DEBUG\fR
Set debug level explicitly. Valid values are 1\-10. See \fB\-v\fR
.IP

.TP
\fBSLURMRESTD_LISTEN\fR
Comma\-delimited list of host:port pairs or unix sockets to listen on.
.IP

.TP
\fBSLURMRESTD_MAX_CONNECTIONS\fR
Set the maximum number of connections to process at any one time. See
\fB\-\-max\-connections\fR
.IP

.TP
\fBSLURMRESTD_OPENAPI_PLUGINS\fR
Comma\-delimited list of OpenAPI plugins to load. See \fB\-s\fR
.IP

.TP
\fBSLURMRESTD_SECURITY\fR
Control slurmrestd security functionality using the following comma\-delimited
values:
.IP
.RS
.TP
\fBbecome_user\fR
Allows \fBslurmrestd\fR to be run as root in order to become the requesting
user for all requests. When combined with \fBrest_auth/local\fB, when a user
connects via a named UNIX socket, \fBslurmrestd\fR will setuid()/setgid() into
that user/group and then complete all requests as the given user. This mode is
only intended for inet mode as the user change is permanent for the life of the
process. This mode is incompatible with \fBrest_auth/jwt\fR and it is suggested
to start \fBslurmrestd\fR with "-a \fBrest_auth/local\fR" arguments.
.IP

.TP
\fBdisable_unshare_files\fR
Disables unsharing file descriptors with parent process.
.IP

.TP
\fBdisable_unshare_sysv\fR
Disables unsharing the SYSV namespace.
.IP

.TP
\fBdisable_user_check\fR
Disables check that slurmrestd is not running as root or SlurmUser, or with the
root or SlurmUser's primary group.
.RE
.IP

.SH "SIGNALS"

.TP 6
\fBSIGINT\fR
\fBslurmrestd\fR will shutdown cleanly.
.IP

.TP
\fBSIGPIPE\fR
This signal is explicitly ignored.
.IP

.SH "NOTES"
\fBSPANK\fR and \fBclifilter\fR plugins are not supported in \fBslurmrestd\fR
due to their lack of thread safety. Active \fBSPANK\fR plugins and
\fBJobSubmitPlugins\fR in \fBslurmctld\fR are independent of slurmrestd and can
be used to enforce site policy on job submissions.

.SH "COPYING"
Copyright (C) 2019\-2022 SchedMD LLC.
.LP
This file is part of Slurm, a resource management program.
For details, see <https://slurm.schedmd.com/>.
.LP
Slurm is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
.LP
Slurm is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
details.

.SH "SEE ALSO"
\fBslurm.conf\fR(5), \fBslurmctld\fR(8), \fBslurmdbd\fR(8)
